<?php

require "[system_path]system/framework.php";

/*$content=implode(",", $_FILES) . implode(",", $_REQUEST);

$filenameNew=file::getFilename($_FILES['Filedata']['name']);
$filenameNew = convert::encodeText($filenameNew);
$filenameNew=convert::convertFilename($filenameNew);

$filenameNew=config::$basePath . "/tmp/files/" . $filenameNew;
//file::getFilename($_FILES['Filedata']['name']);  */



//form::saveForm("[php_property:table]", "[php_property:file_field],objekt", "[php_property:file_field],objekt", "[php_property:file_field]", 100);

$formSave = new form_save();
$formSave->table = "[php_property:table]";
$formSave->formField = "[php_property:file_field]";
//$formSave->urlField = "[php_property:url_field]";
//$formSave->preUrl = "[php_property:pre_url]";
//$formSave->nmTable = "[php_property:nm_table]";
//$formSave->nTable = "[php_property:table]";
//$formSave->mTable = "[php_property:external_table]";
//$formSave->searchIndex = $searchIndex;
$formSave->imageField = "[replace:file_field]";
//$formSave->imageResize = "[replace:image_resize]";

$id = $formSave->saveForm();










// Irgendein Wert muss ausgegeben werden (oder Status Code 200)
echo "ok";

/*if (move_uploaded_file($_FILES['Filedata']['tmp_name'], $filenameNew))
    {
    $content=$content . "success";
    }
else
    {
    $content=$content . "error";
    }

    
    $data = array();
    $data['[php_property:file_field]'] = $filenameNew;
    
    
    db::saveData("[php_property:table]", $data);
    
    
    
    
//file::createTextFile("/tmp/file_" . system::getRandomNumber(100) . ".txt", $content, true);


/*$form = new form();

$field = array();
$field[] = "filedata"; 


$form->saveForm("_document", $field);*/

?>